package com.example.security_demo.response;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 统一返回结果
 *
 * @author zzh
 * @date 2022/5/15
 * @since 1.0
 */
@Data
@NoArgsConstructor
public class ResponseResult {

    private int status;

    private String message;

    private Object data;



    public ResponseResult(int status, String message) {

        this(status, message, null);
    }

    public ResponseResult(int status, String message, Object data) {
        this.status = status;
        this.message = message;
        this.data = data;
    }

    //创建相关理论

    public static ResponseResult success(Object data) {

        return success(10200, "success", data);
    }

    public static ResponseResult success(int status, String message, Object data) {

        return new ResponseResult(status, message, data);
    }


}
